<?php
echo "Paveiksliuko pavadinimas:
<form action='index.php?module=fotos' method='post' enctype='multipart/form-data' id='uploaderok' >
<input type='text' name='fototitle' ><br>
Failo pavadinimas<br><input type='file' name='filename'> <br>
<input type='button' id='uplsender' value='siuntimas' style='border:0;font-family:arial;font-size:12px' >
</form>
";
if($_FILES["filename"]["type"]=="image/gif" || $_FILES["filename"]["type"]=="image/jpeg" || $_FILES["filename"]["type"]=="image/pjpeg"){
if(is_dir($_POST['gall'])){}
else
{
mkdir("upload/".$_POST['gall']);
}
$g=$_POST['gall'].'/'.$_FILES["filename"]["name"];
$uploaddir="upload/".$g;
if(move_uploaded_file($_FILES["filename"]["tmp_name"],$uploaddir))
{}
else 
{ 
echo "blogas įkeliamo failo tipas, o leidžiami:gif ir jpeg";}
$_FILES["filename"]["type"]=null;
}


// vbros v galereju
include_once('../classes/connector.php');
new connectorok();
if(isset($_POST['nazvanie'])&& $_POST['nazvanie']!=null){
mysql_query("INSERT INTO fotogalery (title,galleryname,src) VALUES('$_POST[fototitle]','$_POST[nazvanie]','$g') ") or die(mysql_error());  
}



?>